import type { AxiosRequestConfig } from 'axios'

// 基础响应类型
export interface BaseResponse<T = unknown> {
  code: number
  msg: string
  data: T
  success: boolean
}

// 分页响应类型
export interface IPaginatedResponse<T = unknown> {
  list: T[]
  page: number
  pageSize: number
  total: number
  totalPages: number
}

// 错误响应类型
export interface ErrorResponse {
  code: number
  msg: string
  timestamp?: string
  path?: string
}

// 请求配置扩展
export interface RequestConfig extends AxiosRequestConfig {
  showLoading?: boolean
  showError?: boolean
  retryTimes?: number
}
